home *** CD-ROM | disk | FTP | other *** search
Wrap
<html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> <title>Configure Groups</title> <link rel="stylesheet" type="text/css" href="css/rpmstyle.css"> <style> .GTabBox { height : 200; width : 530; border: none; background-color : activeborder } </style> </head> <body class="bodyc" language="JavaScript" RPMHostIP="!BreakoutBot:MonitorIP!" RPMHostPort="!BreakoutBot:MonitorPort!" RPMUserName="!BreakoutBot:UserName!" BOBDone="!BreakoutBot:Done!" onload="top.banner.savePageCoord(event,document.body,'AdminGroups'); InitRpmCC_AG();" onbeforeunload="DiscoRpmCC_AG()" onresize="processSizeChange()" onclick="checkClick()" onkeydown="processBSP()"> <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script> <script LANGUAGE="JavaScript" src="js/GroupFunc.js"></script> <script LANGUAGE="JavaScript" src="js/ButtonFunc.js"></script> <script LANGUAGE="JavaScript"> <!-- var GMode = ""; // Mode of Operation, New, Edit, Delete, Lookup var CGrpID = "*"; // Computer Group ID var ignoreDBChangeEvent = false; var ReconnectEvent = false; var Hp = 82; var Tid = null; // Capture and ignore script errors window.onerror = wwScrErr; function wwScrErr() { return true; } /* On Load tell the Comm control to Connect to the Server */ function InitRpmCC_AG() { top.MainLoaded = true; // Flag that Main is now loaded initButtonState(); // set initial button state Hp = parseInt(document.body.RPMHostPort,10); RpmCC_AG.Connect(document.body.RPMHostIP,Hp, ""); processSizeChange(); } function processReconnect() { Tid = null; if ( RpmCC_AG.IsConnected() ) { Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection return; } RpmCC_AG.Connect(document.body.RPMHostIP,Hp, ""); } function processConnectConfirmed() { // Restore Filter and Computer Store if ( ReconnectEvent == false ) { processLookupReset(); // go do Group Lookup ReconnectEvent = true; } top.Rstatus.Pstat("Connected"); if ( Tid != null ) { clearTimeout(Tid); // stop timeout routine } Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection } function processConnectionCheck() { Tid = null; RpmCC_AG.SendKeepAlive("Check"); Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection } /* On Unload tell the Comm control to Disconnect from the Server */ function DiscoRpmCC_AG() { RpmCC_AG.Disconnect(); top.banner.processStopCommX(); if ( Tid != null ) { clearTimeout(Tid); // stop timeout routine } } function processNewButton() { GMode = "New"; // Set Mode of operation AG_Group.value = ""; // clear Name field AG_Desc.value = ""; // clear Description field commonNew_Edit(); // Do common processing } function processEditButton() { GMode = "Edit"; // Set Mode of operation commonNew_Edit(); // Do common processing } function commonNew_Edit() { //Common processing for New and Edit /* enable input fields */ AG_Group.className = ""; AG_Desc.className = ""; AG_Desc.readOnly = false; /* enable and disable appropriate buttons */ SetButtonState(GNewButton,"1"); SetButtonState(GEditButton,"1"); SetButtonState(GDeleteButton,"1"); SetButtonState(GUpdateButton,"0"); SetButtonState(GResetButton,"0"); /* enable appropriate Group Name fields */ AG_Group.style.display = ""; AG_GroupSel.style.display = "none"; AG_Group.focus(); } function processUpdateButton() { /* get input which is validated when first entered */ AG_GName = AG_Group.value; AG_GDesc = AG_Desc.value; if (AG_GName.length == 0) { // if no name entered top.Rstatus.Pstat("Please enter a name",true); alert("Please enter a name"); AG_Group.focus(); } else { /* inhibit Update Button now */ SetButtonState(GUpdateButton,"1"); /* Determine if GMode is "New" or "Edit" and send data to DataBase Server appropriately */ if (GMode == "New") { rstat = RpmCC_AG.GroupAdd(AG_GName,AG_GDesc); } else { // "Edit" OrigName = AG_GroupSel.options[GrpSelectIdx].text; AG_GrpID = getGroupID(OrigName,AG_GrpStore); rstat = RpmCC_AG.GroupReplace(AG_GrpID,AG_GName,AG_GDesc); } if ( rstat ) { // if unable to initiate request top.Rstatus.Pstat("Unable to start the UPDATE request",true); processReset(); } else { // waiting for OperationCompleteEvent ignoreDBChangeEvent = true; top.Rstatus.Pstat("One moment while UPDATE request completes"); } } } function processDeleteButton() { GMode = "Delete"; // set mode of operation AG_GName = AG_Group.value; // get Group Name /* ask user to confirm delete */ if ( confirm("Are you sure you want to delete: " + AG_GName + " ?") ) { /* inhibit Edit and Delete now */ SetButtonState(GEditButton,"1"); SetButtonState(GDeleteButton,"1"); processCommonDelete(AG_GName,0); } } /* Computers Still Assigned to Group Delete Request */ function processGroupErrorDeleteDependent() { AG_GName = AG_Group.value; // get Group Name top.Rstatus.Pstat("The DELETE request not completed. There are dependent Computers",true); rs = confirm("There are Computers Still Assigned to Group: " + AG_GName + ".\n Press OK to Delete Group and all Computers in " + AG_GName + ".\n Press Cancel to cancel Delete request."); if (rs) { processCommonDelete(AG_GName,1); } else { top.Rstatus.Pstat("The DELETE request is Cancelled"); SetButtonState(GNewButton,"0"); // Reenable Edit and Delete Buttons SetButtonState(GEditButton,"0"); SetButtonState(GDeleteButton,"0"); if ( AG_GroupSel.style.visibility != "hidden" ) { AG_GroupSel.focus(); } } } /* Common Delete Processing */ function processCommonDelete(GName,Uc) { GrpID = getGroupID(GName,AG_GrpStore); // Get Group ID from Name /* send DELETE request to DataBase Server */ if ( Uc ) { // if Unconditional delete rs = RpmCC_AG.GroupDeleteUnconditional(GrpID); } else { rs = RpmCC_AG.GroupDelete(GrpID); } if ( rs ) { top.Rstatus.Pstat("Unable to start the DELETE request",true); processReset(); } else { // waiting for OperationCompleteEvent ignoreDBChangeEvent = true; top.Rstatus.Pstat("One moment while DELETE request completes"); } } /* Initial Group Lookup Request */ function processLookupReset() { /* Make sure Group Store and Group Name combo are flushed */ lth = AG_GroupSel.length; for (i=0; i < lth; ++i) AG_GroupSel.remove(0); lth = AG_GrpStore.length; for (i=0; i < lth; ++i) AG_GrpStore.remove(0); GrpLupRecCount = 0; // clear Lookup record counter if ( RpmCC_AG.GroupLookup("*","*","*") ) { GMode = ""; top.Rstatus.Pstat("Unable to start the GROUP LOOKUP request",true); } else { GMode = "Lookup"; // set Mode of operation top.Rstatus.Pstat("One moment while GROUP LOOKUP request completes"); } } /* Reset Processing after initial and subsequent Group operations */ function processResetButton() { GrpSelectIdx = 0; // reset index if ( GrpLupRecCount == 0 ) { processCommonReset(); SetButtonState(GEditButton,"1"); SetButtonState(GDeleteButton,"1"); } else { populateInput(0); // set Name and Description fields processCommonReset(); /* select and focus to 1st name entry */ AG_GroupSel.options[0].selected = "selected"; if ( AG_GroupSel.style.visibility != "hidden" ) { AG_GroupSel.focus(); } } } /* Process Combo Group Name Change Event */ function processGroupName() { Nobj = AG_GroupSel; // get object for (i=0; i < Nobj.length; ++i) { if ( Nobj.options[i].selected ) { GrpSelectIdx = i; populateInput(GroupRecLength*i); break; } } } function populateInput(idx) { StoreObj = AG_GrpStore; AG_Group.value = StoreObj.options[idx+0].text; // Synchronize name field with Store name field AG_Desc.value = (StoreObj.options[idx+2].text.length == 0) ? "" : StoreObj.options[idx+2].text; } function updateStore(idx) { StoreObj = AG_GrpStore; AG_GName = AG_Group.value; // Group Name AG_GroupSel.options[idx].text = AG_GName; // Update name in case edited si = GroupRecLength * idx; // index into Store for correct entry StoreObj.options[si+0].text = AG_GName; StoreObj.options[si+2].text = (AG_Desc.value.length == 0) ? "" : AG_Desc.value; } /* Process Group OP Complete Event */ function processGroupOpComplete() { top.Rstatus.Pstat("Request Completed"); if (GMode == "Lookup") { if (GrpLupRecCount == 0) { // check if any records found top.Rstatus.Pstat("No record matches found for GROUP LOOKUP request",true); } processResetButton(); } else if (GMode == "Edit") { /* update the Storage */ updateStore(GrpSelectIdx); processCommonReset(); if ( AG_GroupSel.style.visibility != "hidden" ) { AG_GroupSel.focus(); } } else if (GMode == "Delete") { /* update the Storage */ dix = GroupRecLength*GrpSelectIdx; for (i=0; i < GroupRecLength; ++i) { AG_GrpStore.remove(dix); } AG_GroupSel.remove(GrpSelectIdx); if (AG_GroupSel.length == 0) { // if no more Groups AG_Desc.value = ""; // clear Description field GrpLupRecCount = 0; // clear Group record counter } processResetButton(); } else { // GMode New /* Reset for next */ processLookupReset(); } } function processCommonReset() { /* enable and disable appropriate input fields */ AG_Desc.className = "idis"; AG_Desc.readOnly = true; /* enable and disable appropriate buttons */ SetButtonState(GNewButton,"0"); SetButtonState(GEditButton,"0"); SetButtonState(GDeleteButton,"0"); SetButtonState(GUpdateButton,"1"); SetButtonState(GResetButton,"1"); /* enable appropriate Group Name fields */ AG_Group.style.display = "none"; AG_GroupSel.style.display = ""; } function processKeyPress() { /* get KeyCode and check if invalid */ kc = event.keyCode; stat = 1; // default to OK // Keys: ~ % [ ] # ! if (kc == 126 || kc == 37 || kc == 91 || kc == 93 || kc == 35 || kc == 33) { // Not acceptable stat = 0; } // Keys: * ? else if ( (kc == 42 || kc == 63) && event.srcElement.name != "AG_Group" ) { //Not acceptable stat = 0; } if (stat == 0) { // if Not Acceptable event.returnValue=false; top.Rstatus.Pstat("Keys ~%*?[]#! are not accepted for this field"); alert("Keys ~%*?[]#! are not accepted for this field"); } else { top.Rstatus.Pstat(""); // clear status line } } /* Process Duplicate Error in Group Add / Replace Operation */ function processGroupUpdateErrorDuplicate() { top.Rstatus.Pstat("A duplicate GROUP already exist in the DataBase. Cannot complete the UPDATE request",true); processResetButton(); // reset } /* Process Group ID Not Found Error in EDIT/UPDATE Operation */ function processGroupUpdateErrorBadGroup() { top.Rstatus.Pstat("Group not found in the DataBase. Cannot complete the UPDATE/DELETE request",true); processResetButton(); // reset } /* Set initial button state */ function initButtonState() { SetButtonState(GNewButton,"0"); SetButtonState(GEditButton,"1"); SetButtonState(GDeleteButton,"1"); SetButtonState(GUpdateButton,"1"); SetButtonState(GResetButton,"1"); } function SetButtonState(BtObj,BState) { //BtObj.className = (BState == "0") ? "BoxButton" : "BoxButtonD"; BtObj.disabled = (BState == "0") ? "" : "disabled"; BtObj.bdis = BState; } function processSizeChange() { //PopUpContext Menu bCw = document.body.clientWidth; PopUpContextSize(bCw); } function PopUpContextOpen() { AG_GroupSel.style.visibility = "hidden"; } function PopUpContextClose() { AG_GroupSel.style.visibility = "visible"; } //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="Connected()"> <!-- processConnectConfirmed(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="Disconnected()"> <!-- top.Rstatus.Pstat("Disconnected",true); if ( Tid != null ) { clearTimeout(Tid); // stop timeout routine } Tid = setTimeout("processReconnect()",10000); // Delay 10 secs then try reconnnect //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="DBChanged(cdata)"> <!-- var warr = new Array(); warr = cdata.split("~"); // parse the event data // process only if Group Table change if ( warr[0] == "5" && ignoreDBChangeEvent == false) { top.banner.processDBChangeNotifyEvent(cdata); } ignoreDBChangeEvent = false; //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupAddErrorDuplicate()"> <!-- processGroupUpdateErrorDuplicate(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="ComputerReplaceErrorBadGroup()"> <!-- processGroupUpdateErrorBadGroup(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupOpComplete()"> <!-- processGroupOpComplete(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupOpError()"> <!-- processGroupOpError(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupLookupRecord(Gid,GNme,GDesc)"> <!-- processGroupLookupRecord(Gid,GNme,GDesc,AG_GroupSel,AG_GrpStore); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupErrorDeleteDependant()"> <!-- processGroupErrorDeleteDependent(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupReplaceErrorDuplicate()"> <!-- processGroupUpdateErrorDuplicate(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupErrorDeleteNotFound()"> <!-- processGroupUpdateErrorBadGroup(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="GroupErrorReplaceNotFound()"> <!-- processGroupUpdateErrorBadGroup(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="StartCommunication()"> <!-- top.banner.processStartComm(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_AG" EVENT="StopCommunication()"> <!-- top.banner.processStopComm(); //--> </script> <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script> <object ID="RpmCC_AG" NAME="RpmCC_AG" WIDTH="14" HEIGHT="1" style="display:none" CLASSID="CLSID:D88C2358-FC83-11D1-BF49-00104B2D6F80" CODEBASE="controls/RPMComm.cab#version=5,2,0,0"> <param name="_Version" value="65536"> <param name="_ExtentX" value="2646"> <param name="_ExtentY" value="1341"> <param name="_StockProps" value="0"> </object> <center><div class="GTabBox" border="0" > <center> <div align="left" style="clear:both"> <table border="1" borderColor="activeborder" align="left"> <tr><td borderColorDark="graytext" borderColorLight="white" height="25" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/sAdminGroups.gif" align="absmiddle" height="16" width="16"> Configure Groups </td><td width="*"></td> </tr></table><br><br> </div> <div align="left" style="clear:both"> <table class="fldset" border="0" width="522" cellspacing="3" cellpadding="2" height="125"> <tr> <td width="505" height="120"><div align="left"><table border="0" width="500" cellspacing="3" cellpadding="2" height="80"> <tr> <td width="150" align="right" class="inputlabel" height="1">Group Name:</td> <td width="350" height="30"><input TYPE="text" SIZE="40" NAME="AG_Group" maxLength="40" onkeypress="processKeyPress();" onkeydown="processKeyDown();" style="display: none" onFocus="chkDisabled(this)"> <select ONCHANGE="processGroupName()" SIZE="1" NAME="AG_GroupSel" class="idis" style="width: 200pt"> </select> <select SIZE="1" NAME="AG_GrpStore" style="display: none"> </select> </td> </tr> <tr> <td width="150" align="right" class="inputlabel" height="30">Group Description:</td> <td width="350" height="1"><input TYPE="text" SIZE="50" NAME="AG_Desc" maxLength="64" onkeypress="processKeyPress();" onkeydown="processKeyDown();" onFocus="chkDisabled(this)" class="idis"> </td> </tr> </table> </div></td> </tr> </table> <table class="fldset" border="1" width="522" cellspacing="1" cellpadding="1" height="40"> <tr> <td width="505" align="center" height="40"> <button id="GNewButton" title="Enter a New Group" onclick="if (this.bdis == '0') processNewButton();" bdis="0" style="width:80px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" disabled><img src="images/NewImg.gif" align="absmiddle" height="14" width="13"> New</button> <button id="GEditButton" title="Edit the selected Group" onclick="if (this.bdis == '0') processEditButton();" bdis="0" style="width:80px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" disabled><img src="images/ConfigImg.gif" align="absmiddle" height="18" width="17"> Edit</button> <button id="GDeleteButton" title="Delete the selected Group" onclick="if (this.bdis == '0') processDeleteButton();" bdis="0" style="width:80px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" disabled><img src="images/DelImg.gif" align="absmiddle" height="14" width="14">Delete</button> <button id="GUpdateButton" title="Update database for the selected Group" onclick="if (this.bdis == '0') processUpdateButton();" bdis="0" style="width:80px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" disabled><img src="images/sSave.gif" align="absmiddle" height="15" width="15"> Save</button> <button id="GResetButton" title="Cancel and return to New" onclick="if (this.bdis == '0') processResetButton();" bdis="0" style="width:80px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" disabled><img src="images/reset.gif" align="absmiddle" height="15" width="15">Cancel</button></td> </tr> </table></div> </center></div> </center> </body> </html>